package org.hao.samples.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "exam_score")
public class ExamScore implements Serializable {
	private static final long serialVersionUID = -6530168542617015609L;

	@Id
	@GeneratedValue
	@Column(name = "id", nullable = false)
	private Integer id;

	@Column(name = "user_id", nullable = false)
	private Integer userId;

	@ManyToOne(cascade = { CascadeType.DETACH, CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(name = "subject_id")
	private Subject subject;

	@Column(name = "exam_time", nullable = false)
	private Date examTime;

	@Column(name = "score", nullable = false)
	private Double score;

	@Column(name = "testId", nullable = false)
	private String testId;

	public ExamScore() {
		super();
	}

	public ExamScore(Integer id, Integer userId, Subject subject, Date examTime, Double score, String testId) {
		super();
		this.id = id;
		this.userId = userId;
		this.subject = subject;
		this.examTime = examTime;
		this.score = score;
		this.testId = testId;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Subject getSubject() {
		return subject;
	}

	public void setSubject(Subject subject) {
		this.subject = subject;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Date getExamTime() {
		return examTime;
	}

	public void setExamTime(Date examTime) {
		this.examTime = examTime;
	}

	public Double getScore() {
		return score;
	}

	public void setScore(Double score) {
		this.score = score;
	}

	public String getTestId() {
		return testId;
	}

	public void setTestId(String testId) {
		this.testId = testId;
	}

}
